//
//  ABCTabBar.swift
//  ABCWeiBo
//
//  Created by 刘斌 on 2017/8/1.
//  Copyright © 2017年 刘斌161040149. All rights reserved.
//

import UIKit

class ABCTabBar: UITabBar {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(code) has not been implemented")
    }
// MARK: -设置视图
    func setUI(){
        addSubview(composeButton)
    }
   override func layoutSubviews() {
        super.layoutSubviews()
    composeButton.center.x=frame.width*0.5
    composeButton.center.y=frame.height*0.5
    }
    // MARK: -懒加载
    lazy var composeButton:UIButton = {
        let btn = UIButton()
        btn.setImage(UIImage(named: "tabbar_compose_icon_add"), for: UIControlState.normal)
        btn.setImage(UIImage(named: "tabbar_compose_icon_add_highlighted"), for: UIControlState.highlighted)
        btn.setBackgroundImage(UIImage(named: "tabbar_compose_button"), for: UIControlState.normal)
        btn.setBackgroundImage(UIImage(named: "tabbar_compose_button_highlighted"), for: UIControlState.highlighted)
        //通过背景图片大小d按钮大小
        btn.sizeToFit()
        return btn
    }()
}
